/*
 Navicat Premium Data Transfer

 Source Server         : 阿里云服务器：SQL Server
 Source Server Type    : SQL Server
 Source Server Version : 13005026
 Source Host           : 121.40.101.29:1433
 Source Catalog        : scm_main_sfl_visit_dev
 Source Schema         : dbo

 Target Server Type    : SQL Server
 Target Server Version : 13005026
 File Encoding         : 65001

 Date: 21/09/2020 14:21:42
*/


-- ----------------------------
-- Table structure for bd_enclosure
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[bd_enclosure]') AND type IN ('U'))
	DROP TABLE [dbo].[bd_enclosure]
GO

CREATE TABLE [dbo].[bd_enclosure] (
  [id] int  IDENTITY(1,1) NOT NULL,
  [order_id] numeric(18)  NOT NULL,
  [order_type] int  NOT NULL,
  [original_name] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [enclosure_addr] varchar(255) COLLATE Chinese_PRC_CI_AS  NOT NULL,
  [creater_id] varchar(255) COLLATE Chinese_PRC_CI_AS  NULL,
  [create_time] datetime DEFAULT (getdate()) NOT NULL
)
GO

ALTER TABLE [dbo].[bd_enclosure] SET (LOCK_ESCALATION = TABLE)
GO

EXEC sp_addextendedproperty
'MS_Description', N'表id',
'SCHEMA', N'dbo',
'TABLE', N'bd_enclosure',
'COLUMN', N'id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单子ID(访客单ID)',
'SCHEMA', N'dbo',
'TABLE', N'bd_enclosure',
'COLUMN', N'order_id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'单子类型(1:请假,2:加班,3:补出勤,4:访客)',
'SCHEMA', N'dbo',
'TABLE', N'bd_enclosure',
'COLUMN', N'order_type'
GO

EXEC sp_addextendedproperty
'MS_Description', N'附件原始名称',
'SCHEMA', N'dbo',
'TABLE', N'bd_enclosure',
'COLUMN', N'original_name'
GO

EXEC sp_addextendedproperty
'MS_Description', N'附件地址',
'SCHEMA', N'dbo',
'TABLE', N'bd_enclosure',
'COLUMN', N'enclosure_addr'
GO

EXEC sp_addextendedproperty
'MS_Description', N'记录创建人',
'SCHEMA', N'dbo',
'TABLE', N'bd_enclosure',
'COLUMN', N'creater_id'
GO

EXEC sp_addextendedproperty
'MS_Description', N'记录创建时间',
'SCHEMA', N'dbo',
'TABLE', N'bd_enclosure',
'COLUMN', N'create_time'
GO

EXEC sp_addextendedproperty
'MS_Description', N'附件表',
'SCHEMA', N'dbo',
'TABLE', N'bd_enclosure'
GO


-- ----------------------------
-- Primary Key structure for table bd_enclosure
-- ----------------------------
ALTER TABLE [dbo].[bd_enclosure] ADD CONSTRAINT [PK_BD_ENCLOSURE] PRIMARY KEY CLUSTERED ([id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)  
ON [PRIMARY]
GO

